
#ifndef TimeSpan_h
#define TimeSpan_h


// CSharp includes.
#include <Typedef.h>
#include <Defines.h>

#include <System/Object.h>
#include <System/IComparable.h>
#include <System/Generic/IComparable.h>
#include <System/Generic/IEquatable.h>
#include <System/IFormattable.h>
#include <System/Globalization/TimeSpanStyles.h>
#include <System/IFormatProvider.h>
#include <System/OverflowException.h>
#include <System/ArgumentException.h>
#include <System/Text/StringBuilder.h>

namespace Riccsson
{
	namespace System
	{
		// Summary:
		//     Represents a time interval.
		//[Serializable]
		//[ComVisible(true)]
		struct TimeSpan
			: public Riccsson::System::IComparable
			, public Riccsson::System::Generic::IComparable<TimeSpan>
			, public Riccsson::System::Generic::IEquatable<TimeSpan>
			, public Riccsson::System::IFormattable
		{
		private:
			long long _ticks;

			
			PROP3GET(TimeSpan, int, Days);
			PROP3GET(TimeSpan, int, Hours);
			PROP3GET(TimeSpan, int, Milliseconds);
			PROP3GET(TimeSpan, int, Minutes);
			PROP3GET(TimeSpan, int, Seconds);
			PROP3GET(TimeSpan, long long, Ticks);
			PROP3GET(TimeSpan, double, TotalDays);
			PROP3GET(TimeSpan, double, TotalHours);
			PROP3GET(TimeSpan, double, TotalMilliseconds);
			PROP3GET(TimeSpan, double, TotalMinutes);
			PROP3GET(TimeSpan, double, TotalSeconds);


			// Summary:
			//     Represents the number of ticks in 1 day. This field is constant.
			public: static const long long TicksPerDay;
			//
			// Summary:
			//     Represents the number of ticks in 1 hour. This field is constant.
			public: static const long long TicksPerHour;
			//
			// Summary:
			//     Represents the number of ticks in 1 millisecond. This field is constant.
			public: static const long long TicksPerMillisecond;
			//
			// Summary:
			//     Represents the number of ticks in 1 minute. This field is constant.
			public: static const long long TicksPerMinute;
			//
			// Summary:
			//     Represents the number of ticks in 1 second.
			public: static const long long TicksPerSecond;

			// Summary:
			//     Represents the maximum System.TimeSpan value. This field is read-only.
			public: static readonly TimeSpan MaxValue;
			//
			// Summary:
			//     Represents the minimum System.TimeSpan value. This field is read-only.
			public: static readonly TimeSpan MinValue;
			//
			// Summary:
			//     Represents the zero System.TimeSpan value. This field is read-only.
			public: static readonly TimeSpan Zero;
				
			//----------------------------------------------------------------------------
			COPY_CONSTRUCTOR(TimeSpan)
			{
				PROP3GET_INIT_COPY(TimeSpan, int, Days);
				PROP3GET_INIT_COPY(TimeSpan, int, Hours);
				PROP3GET_INIT_COPY(TimeSpan, int, Milliseconds);
				PROP3GET_INIT_COPY(TimeSpan, int, Minutes);
				PROP3GET_INIT_COPY(TimeSpan, int, Seconds);
				PROP3GET_INIT_COPY(TimeSpan, long long, Ticks);
				PROP3GET_INIT_COPY(TimeSpan, double, TotalDays);
				PROP3GET_INIT_COPY(TimeSpan, double, TotalHours);
				PROP3GET_INIT_COPY(TimeSpan, double, TotalMilliseconds);
				PROP3GET_INIT_COPY(TimeSpan, double, TotalMinutes);
				PROP3GET_INIT_COPY(TimeSpan, double, TotalSeconds);

				_ticks = other._ticks;
			}

			//----------------------------------------------------------------------------
			public: TimeSpan();

			//----------------------------------------------------------------------------
			private: static bool CalculateTicks (int days, int hours, int minutes, int seconds, int milliseconds, bool throwExc, long long out result);

			//----------------------------------------------------------------------------
			private: static TimeSpan From(double value, long long tickMultiplicator);


			//
			// Summary:
			//     Initializes a new System.TimeSpan to the specified number of ticks.
			//
			// Parameters:
			//   ticks:
			//     A time period expressed in 100-nanosecond units.
			public: TimeSpan(long long ticks);

			//
			// Summary:
			//     Initializes a new System.TimeSpan to a specified number of hours, minutes,
			//     and seconds.
			//
			// Parameters:
			//   hours:
			//     Number of hours.
			//
			//   minutes:
			//     Number of minutes.
			//
			//   seconds:
			//     Number of seconds.
			//
			// Exceptions:
			//   System.ArgumentOutOfRangeException:
			//     The parameters specify a System.TimeSpan value less than System.TimeSpan.MinValue
			//     or greater than System.TimeSpan.MaxValue.
			//[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
			public: TimeSpan(int hours, int minutes, int seconds);

			//
			// Summary:
			//     Initializes a new System.TimeSpan to a specified number of days, hours, minutes,
			//     and seconds.
			//
			// Parameters:
			//   days:
			//     Number of days.
			//
			//   hours:
			//     Number of hours.
			//
			//   minutes:
			//     Number of minutes.
			//
			//   seconds:
			//     Number of seconds.
			//
			// Exceptions:
			//   System.ArgumentOutOfRangeException:
			//     The parameters specify a System.TimeSpan value less than System.TimeSpan.MinValue
			//     or greater than System.TimeSpan.MaxValue.
			public: TimeSpan(int days, int hours, int minutes, int seconds);

			//
			// Summary:
			//     Initializes a new System.TimeSpan to a specified number of days, hours, minutes,
			//     seconds, and milliseconds.
			//
			// Parameters:
			//   days:
			//     Number of days.
			//
			//   hours:
			//     Number of hours.
			//
			//   minutes:
			//     Number of minutes.
			//
			//   seconds:
			//     Number of seconds.
			//
			//   milliseconds:
			//     Number of milliseconds.
			//
			// Exceptions:
			//   System.ArgumentOutOfRangeException:
			//     The parameters specify a System.TimeSpan value less than System.TimeSpan.MinValue
			//     or greater than System.TimeSpan.MaxValue.
			public: TimeSpan(int days, int hours, int minutes, int seconds, int milliseconds);

			// Summary:
			//     Gets the days component of the time interval represented by the current System.TimeSpan
			//     structure.
			//
			// Returns:
			//     The day component of this instance. The return value can be positive or negative.
			public: PROP3_GET(int, Days);

			//
			// Summary:
			//     Gets the hours component of the time interval represented by the current
			//     System.TimeSpan structure.
			//
			// Returns:
			//     The hour component of the current System.TimeSpan structure. The return value
			//     ranges from -23 through 23.
			public: PROP3_GET(int, Hours);

			//
			// Summary:
			//     Gets the milliseconds component of the time interval represented by the current
			//     System.TimeSpan structure.
			//
			// Returns:
			//     The millisecond component of the current System.TimeSpan structure. The return
			//     value ranges from -999 through 999.
			public: PROP3_GET(int, Milliseconds);

			//
			// Summary:
			//     Gets the minutes component of the time interval represented by the current
			//     System.TimeSpan structure.
			//
			// Returns:
			//     The minute component of the current System.TimeSpan structure. The return
			//     value ranges from -59 through 59.
			public: PROP3_GET(int, Minutes);

			//
			// Summary:
			//     Gets the seconds component of the time interval represented by the current
			//     System.TimeSpan structure.
			//
			// Returns:
			//     The second component of the current System.TimeSpan structure. The return
			//     value ranges from -59 through 59.
			public: PROP3_GET(int, Seconds);

			//
			// Summary:
			//     Gets the number of ticks that represent the value of the current System.TimeSpan
			//     structure.
			//
			// Returns:
			//     The number of ticks contained in this instance.
			public: PROP3_GET(long long, Ticks);

			//
			// Summary:
			//     Gets the value of the current System.TimeSpan structure expressed in whole
			//     and fractional days.
			//
			// Returns:
			//     The total number of days represented by this instance.
			public: PROP3_GET(double, TotalDays);

			//
			// Summary:
			//     Gets the value of the current System.TimeSpan structure expressed in whole
			//     and fractional hours.
			//
			// Returns:
			//     The total number of hours represented by this instance.
			public: PROP3_GET(double, TotalHours);

			//
			// Summary:
			//     Gets the value of the current System.TimeSpan structure expressed in whole
			//     and fractional milliseconds.
			//
			// Returns:
			//     The total number of milliseconds represented by this instance.
			public: PROP3_GET(double, TotalMilliseconds);

			//
			// Summary:
			//     Gets the value of the current System.TimeSpan structure expressed in whole
			//     and fractional minutes.
			//
			// Returns:
			//     The total number of minutes represented by this instance.
			public: PROP3_GET(double, TotalMinutes);

			//
			// Summary:
			//     Gets the value of the current System.TimeSpan structure expressed in whole
			//     and fractional seconds.
			//
			// Returns:
			//     The total number of seconds represented by this instance.
			public: PROP3_GET(double, TotalSeconds);

			// Summary:
			//     Returns a new System.TimeSpan object whose value is the sum of the specified
			//     System.TimeSpan object and this instance.
			//
			// Parameters:
			//   ts:
			//     The time interval to add.
			//
			// Returns:
			//     A new object that represents the value of this instance plus the value of
			//     ts.
			//
			// Exceptions:
			//   System.OverflowException:
			//     The resulting System.TimeSpan is less than System.TimeSpan.MinValue or greater
			//     than System.TimeSpan.MaxValue.
			public: TimeSpan Add(TimeSpan ts);

			//
			// Summary:
			//     Compares two System.TimeSpan values and returns an integer that indicates
			//     whether the first value is shorter than, equal to, or longer than the second
			//     value.
			//
			// Parameters:
			//   t1:
			//     The first time interval to compare.
			//
			//   t2:
			//     The second time interval to compare.
			//
			// Returns:
			//     One of the following values.Value Description -1 t1 is shorter than t2. 0
			//     t1 is equal to t2. 1 t1 is longer than t2.
			public: static int Compare(TimeSpan t1, TimeSpan t2);

			//
			// Summary:
			//     Compares this instance to a specified object and returns an integer that
			//     indicates whether this instance is shorter than, equal to, or longer than
			//     the specified object.
			//
			// Parameters:
			//   value:
			//     An object to compare, or null.
			//
			// Returns:
			//     One of the following values.Value Description -1 This instance is shorter
			//     than value. 0 This instance is equal to value. 1 This instance is longer
			//     than value.-or- value is null.
			//
			// Exceptions:
			//   System.ArgumentException:
			//     value is not a System.TimeSpan.
			public: int CompareTo(object* value);

			//
			// Summary:
			//     Compares this instance to a specified System.TimeSpan object and returns
			//     an integer that indicates whether this instance is shorter than, equal to,
			//     or longer than the System.TimeSpan object.
			//
			// Parameters:
			//   value:
			//     An object to compare to this instance.
			//
			// Returns:
			//     A signed number indicating the relative values of this instance and value.Value
			//     Description A negative integer This instance is shorter than value. Zero
			//     This instance is equal to value. A positive integer This instance is longer
			//     than value.
			public: int CompareTo(TimeSpan* value);

			//
			// Summary:
			//     Returns a new System.TimeSpan object whose value is the absolute value of
			//     the current System.TimeSpan object.
			//
			// Returns:
			//     A new object whose value is the absolute value of the current System.TimeSpan
			//     object.
			//
			// Exceptions:
			//   System.OverflowException:
			//     The value of this instance is System.TimeSpan.MinValue.
			public: TimeSpan Duration();

			//
			// Summary:
			//     Returns a value indicating whether this instance is equal to a specified
			//     object.
			//
			// Parameters:
			//   value:
			//     An object to compare with this instance.
			//
			// Returns:
			//     true if value is a System.TimeSpan object that represents the same time interval
			//     as the current System.TimeSpan structure; otherwise, false.
			public: override bool Equals(object* value);

			//
			// Summary:
			//     Returns a value indicating whether this instance is equal to a specified
			//     System.TimeSpan object.
			//
			// Parameters:
			//   obj:
			//     An object to compare with this instance.
			//
			// Returns:
			//     true if obj represents the same time interval as this instance; otherwise,
			//     false.
			public: bool Equals(TimeSpan* obj);

			//
			// Summary:
			//     Returns a value that indicates whether two specified instances of System.TimeSpan
			//     are equal.
			//
			// Parameters:
			//   t1:
			//     The first time interval to compare.
			//
			//   t2:
			//     The second time interval to compare.
			//
			// Returns:
			//     true if the values of t1 and t2 are equal; otherwise, false.
			public: static bool Equals(TimeSpan t1, TimeSpan t2);

			//
			// Summary:
			//     Returns a System.TimeSpan that represents a specified number of days, where
			//     the specification is accurate to the nearest millisecond.
			//
			// Parameters:
			//   value:
			//     A number of days, accurate to the nearest millisecond.
			//
			// Returns:
			//     An object that represents value.
			//
			// Exceptions:
			//   System.OverflowException:
			//     value is less than System.TimeSpan.MinValue or greater than System.TimeSpan.MaxValue.
			//     -or-value is System.Double.PositiveInfinity.-or-value is System.Double.NegativeInfinity.
			//
			//   System.ArgumentException:
			//     value is equal to System.Double.NaN.
			public: static TimeSpan FromDays(double value);

			//
			// Summary:
			//     Returns a System.TimeSpan that represents a specified number of hours, where
			//     the specification is accurate to the nearest millisecond.
			//
			// Parameters:
			//   value:
			//     A number of hours accurate to the nearest millisecond.
			//
			// Returns:
			//     An object that represents value.
			//
			// Exceptions:
			//   System.OverflowException:
			//     value is less than System.TimeSpan.MinValue or greater than System.TimeSpan.MaxValue.
			//     -or-value is System.Double.PositiveInfinity.-or-value is System.Double.NegativeInfinity.
			//
			//   System.ArgumentException:
			//     value is equal to System.Double.NaN.
			public: static TimeSpan FromHours(double value);

			//
			// Summary:
			//     Returns a System.TimeSpan that represents a specified number of milliseconds.
			//
			// Parameters:
			//   value:
			//     A number of milliseconds.
			//
			// Returns:
			//     An object that represents value.
			//
			// Exceptions:
			//   System.OverflowException:
			//     value is less than System.TimeSpan.MinValue or greater than System.TimeSpan.MaxValue.-or-value
			//     is System.Double.PositiveInfinity.-or-value is System.Double.NegativeInfinity.
			//
			//   System.ArgumentException:
			//     value is equal to System.Double.NaN.
			public: static TimeSpan FromMilliseconds(double value);

			//
			// Summary:
			//     Returns a System.TimeSpan that represents a specified number of minutes,
			//     where the specification is accurate to the nearest millisecond.
			//
			// Parameters:
			//   value:
			//     A number of minutes, accurate to the nearest millisecond.
			//
			// Returns:
			//     An object that represents value.
			//
			// Exceptions:
			//   System.OverflowException:
			//     value is less than System.TimeSpan.MinValue or greater than System.TimeSpan.MaxValue.-or-value
			//     is System.Double.PositiveInfinity.-or-value is System.Double.NegativeInfinity.
			//
			//   System.ArgumentException:
			//     value is equal to System.Double.NaN.
			public: static TimeSpan FromMinutes(double value);

			//
			// Summary:
			//     Returns a System.TimeSpan that represents a specified number of seconds,
			//     where the specification is accurate to the nearest millisecond.
			//
			// Parameters:
			//   value:
			//     A number of seconds, accurate to the nearest millisecond.
			//
			// Returns:
			//     An object that represents value.
			//
			// Exceptions:
			//   System.OverflowException:
			//     value is less than System.TimeSpan.MinValue or greater than System.TimeSpan.MaxValue.-or-value
			//     is System.Double.PositiveInfinity.-or-value is System.Double.NegativeInfinity.
			//
			//   System.ArgumentException:
			//     value is equal to System.Double.NaN.
			public: static TimeSpan FromSeconds(double value);

			//
			// Summary:
			//     Returns a System.TimeSpan that represents a specified time, where the specification
			//     is in units of ticks.
			//
			// Parameters:
			//   value:
			//     A number of ticks that represent a time.
			//
			// Returns:
			//     An object that represents value.
			//[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
			public: static TimeSpan FromTicks(long value);

			//
			// Summary:
			//     Returns a hash code for this instance.
			//
			// Returns:
			//     A 32-bit signed integer hash code.
			public: override int GetHashCode();

			//
			// Summary:
			//     Returns a new System.TimeSpan object whose value is the negated value of
			//     this instance.
			//
			// Returns:
			//     A new object with the same numeric value as this instance, but with the opposite
			//     sign.
			//
			// Exceptions:
			//   System.OverflowException:
			//     The negated value of this instance cannot be represented by a System.TimeSpan;
			//     that is, the value of this instance is System.TimeSpan.MinValue.
			public: TimeSpan Negate();

			//
			// Summary:
			//     Converts the string representation of a time interval to its System.TimeSpan
			//     equivalent.
			//
			// Parameters:
			//   s:
			//     A string that specifies the time interval to convert.
			//
			// Returns:
			//     A time interval that corresponds to s.
			//
			// Exceptions:
			//   System.ArgumentNullException:
			//     s is null.
			//
			//   System.FormatException:
			//     s has an invalid format.
			//
			//   System.OverflowException:
			//     s represents a number that is less than System.TimeSpan.MinValue or greater
			//     than System.TimeSpan.MaxValue.-or- At least one of the days, hours, minutes,
			//     or seconds components is outside its valid range.
			public: static TimeSpan Parse(string* s);

			//
			// Summary:
			//     Converts the string representation of a time interval to its System.TimeSpan
			//     equivalent by using the specified culture-specific format information.
			//
			// Parameters:
			//   input:
			//     A string that specifies the time interval to convert.
			//
			//   formatProvider:
			//     An object that supplies culture-specific formatting information.
			//
			// Returns:
			//     A time interval that corresponds to input, as specified by formatProvider.
			//
			// Exceptions:
			//   System.ArgumentNullException:
			//     input is null.
			//
			//   System.FormatException:
			//     input has an invalid format.
			//
			//   System.OverflowException:
			//     input represents a number that is less than System.TimeSpan.MinValue or greater
			//     than System.TimeSpan.MaxValue.-or- At least one of the days, hours, minutes,
			//     or seconds components in input is outside its valid range.
			public: static TimeSpan Parse(string* input, IFormatProvider* formatProvider);

			//
			// Summary:
			//     Converts the string representation of a time interval to its System.TimeSpan
			//     equivalent by using the specified format and culture-specific format information.
			//     The format of the string representation must match the specified format exactly.
			//
			// Parameters:
			//   input:
			//     A string that specifies the time interval to convert.
			//
			//   format:
			//     A standard or custom format string that defines the required format of input.
			//
			//   formatProvider:
			//     An object that provides culture-specific formatting information.
			//
			// Returns:
			//     A time interval that corresponds to input, as specified by format and formatProvider.
			//
			// Exceptions:
			//   System.ArgumentNullException:
			//     input is null.
			//
			//   System.FormatException:
			//     input has an invalid format.
			//
			//   System.OverflowException:
			//     input represents a number that is less than System.TimeSpan.MinValue or greater
			//     than System.TimeSpan.MaxValue.-or- At least one of the days, hours, minutes,
			//     or seconds components in input is outside its valid range.
			public: static TimeSpan ParseExact(string* input, string* format, IFormatProvider* formatProvider);

			//
			// Summary:
			//     Converts the string representation of a time interval to its System.TimeSpan
			//     equivalent by using the specified array of format strings and culture-specific
			//     format information. The format of the string representation must match one
			//     of the specified formats exactly.
			//
			// Parameters:
			//   input:
			//     A string that specifies the time interval to convert.
			//
			//   formats:
			//     A array of standard or custom format strings that defines the required format
			//     of input.
			//
			//   formatProvider:
			//     An object that provides culture-specific formatting information.
			//
			// Returns:
			//     A time interval that corresponds to input, as specified by formats and formatProvider.
			//
			// Exceptions:
			//   System.ArgumentNullException:
			//     input is null.
			//
			//   System.FormatException:
			//     input has an invalid format.
			//
			//   System.OverflowException:
			//     input represents a number that is less than System.TimeSpan.MinValue or greater
			//     than System.TimeSpan.MaxValue.-or- At least one of the days, hours, minutes,
			//     or seconds components in input is outside its valid range.
			public: static TimeSpan ParseExact(string* input, Array<string>* formats, IFormatProvider* formatProvider);

			//
			// Summary:
			//     Converts the string representation of a time interval to its System.TimeSpan
			//     equivalent by using the specified format, culture-specific format information,
			//     and styles. The format of the string representation must match the specified
			//     format exactly.
			//
			// Parameters:
			//   input:
			//     A string that specifies the time interval to convert.
			//
			//   format:
			//     A standard or custom format string that defines the required format of input.
			//
			//   formatProvider:
			//     An object that provides culture-specific formatting information.
			//
			//   styles:
			//     A bitwise combination of enumeration values that defines the style elements
			//     that may be present in input.
			//
			// Returns:
			//     A time interval that corresponds to input, as specified by format, formatProvider,
			//     and styles.
			//
			// Exceptions:
			//   System.ArgumentException:
			//     styles is an invalid System.Globalization.TimeSpanStyles* value.
			//
			//   System.ArgumentNullException:
			//     input is null.
			//
			//   System.FormatException:
			//     input has an invalid format.
			//
			//   System.OverflowException:
			//     input represents a number that is less than System.TimeSpan.MinValue or greater
			//     than System.TimeSpan.MaxValue.-or- At least one of the days, hours, minutes,
			//     or seconds components in input is outside its valid range.
			public: static TimeSpan ParseExact(string* input, string* format, IFormatProvider* formatProvider, Globalization::TimeSpanStyles* styles);

			//
			// Summary:
			//     Converts the string representation of a time interval to its System.TimeSpan
			//     equivalent by using the specified formats, culture-specific format information,
			//     and styles. The format of the string representation must match one of the
			//     specified formats exactly.
			//
			// Parameters:
			//   input:
			//     A string that specifies the time interval to convert.
			//
			//   formats:
			//     A array of standard or custom format strings that define the required format
			//     of input.
			//
			//   formatProvider:
			//     An object that provides culture-specific formatting information.
			//
			//   styles:
			//     A bitwise combination of enumeration values that defines the style elements
			//     that may be present in input.
			//
			// Returns:
			//     A time interval that corresponds to input, as specified by formats, formatProvider,
			//     and styles.
			//
			// Exceptions:
			//   System.ArgumentException:
			//     styles is an invalid System.Globalization.TimeSpanStyles* value.
			//
			//   System.ArgumentNullException:
			//     input is null.
			//
			//   System.FormatException:
			//     input has an invalid format.
			//
			//   System.OverflowException:
			//     input represents a number that is less than System.TimeSpan.MinValue or greater
			//     than System.TimeSpan.MaxValue.-or- At least one of the days, hours, minutes,
			//     or seconds components in input is outside its valid range.
			public: static TimeSpan ParseExact(string* input, Array<string>* formats, IFormatProvider* formatProvider, Globalization::TimeSpanStyles* styles);

			//
			// Summary:
			//     Returns a new System.TimeSpan object whose value is the difference between
			//     the specified System.TimeSpan object and this instance.
			//
			// Parameters:
			//   ts:
			//     The time interval to be subtracted.
			//
			// Returns:
			//     A new time interval whose value is the result of the value of this instance
			//     minus the value of ts.
			//
			// Exceptions:
			//   System.OverflowException:
			//     The return value is less than System.TimeSpan.MinValue or greater than System.TimeSpan.MaxValue.
			public: TimeSpan Subtract(TimeSpan ts);

			//
			// Summary:
			//     Converts the value of the current System.TimeSpan object to its equivalent
			//     string representation.
			//
			// Returns:
			//     The string representation of the current System.TimeSpan value.
			public: override GC_PTR<string> ToString() const;

			//
			// Summary:
			//     Converts the value of the current System.TimeSpan object to its equivalent
			//     string representation by using the specified format.
			//
			// Parameters:
			//   format:
			//     A standard or custom System.TimeSpan format string.
			//
			// Returns:
			//     The string representation of the current System.TimeSpan value in the format
			//     specified by the format parameter.
			//
			// Exceptions:
			//   System.FormatException:
			//     The format parameter is not recognized or is not supported.
			public: GC_PTR<string> ToString(string* format);

			//
			// Summary:
			//     Converts the value of the current System.TimeSpan object to its equivalent
			//     string representation by using the specified format and culture-specific
			//     formatting information.
			//
			// Parameters:
			//   format:
			//     A standard or custom System.TimeSpan format string.
			//
			//   formatProvider:
			//     An object that supplies culture-specific formatting information.
			//
			// Returns:
			//     The string representation of the current System.TimeSpan value, as specified
			//     by format and formatProvider.
			//
			// Exceptions:
			//   System.FormatException:
			//     The format parameter is not recognized or is not supported.
			public: GC_PTR<string> ToString(string* format, IFormatProvider* formatProvider);

			//
			// Summary:
			//     Converts the string representation of a time interval to its System.TimeSpan
			//     equivalent and returns a value that indicates whether the conversion succeeded.
			//
			// Parameters:
			//   s:
			//     A string that specifies the time interval to convert.
			//
			//   result:
			//     When this method returns, contains an object that represents the time interval
			//     specified by s, or System.TimeSpan.Zero if the conversion failed. This parameter
			//     is passed uninitialized.
			//
			// Returns:
			//     true if s was converted successfully; otherwise, false. This operation returns
			//     false if the s parameter is null or System.String.Empty, has an invalid format,
			//     represents a time interval that is less than System.TimeSpan.MinValue or
			//     greater than System.TimeSpan.MaxValue, or has at least one days, hours, minutes,
			//     or seconds component outside its valid range.
			public: static bool TryParse(string* s, TimeSpan out result);

			//
			// Summary:
			//     Converts the string representation of a time interval to its System.TimeSpan
			//     equivalent by using the specified culture-specific formatting information,
			//     and returns a value that indicates whether the conversion succeeded.
			//
			// Parameters:
			//   input:
			//     A string that specifies the time interval to convert.
			//
			//   formatProvider:
			//     An object that supplies culture-specific formatting information.
			//
			//   result:
			//     When this method returns, contains an object that represents the time interval
			//     specified by input, or System.TimeSpan.Zero if the conversion failed. This
			//     parameter is passed uninitialized.
			//
			// Returns:
			//     true if input was converted successfully; otherwise, false. This operation
			//     returns false if the input parameter is null or System.String.Empty, has
			//     an invalid format, represents a time interval that is less than System.TimeSpan.MinValue
			//     or greater than System.TimeSpan.MaxValue, or has at least one days, hours,
			//     minutes, or seconds component outside its valid range.
			public: static bool TryParse(string* input, IFormatProvider* formatProvider, TimeSpan out result);

			//
			// Summary:
			//     Converts the string representation of a time interval to its System.TimeSpan
			//     equivalent by using the specified format and culture-specific format information,
			//     and returns a value that indicates whether the conversion succeeded. The
			//     format of the string representation must match the specified format exactly.
			//
			// Parameters:
			//   input:
			//     A string that specifies the time interval to convert.
			//
			//   format:
			//     A standard or custom format string that defines the required format of input.
			//
			//   formatProvider:
			//     An object that supplies culture-specific formatting information.
			//
			//   result:
			//     When this method returns, contains an object that represents the time interval
			//     specified by input, or System.TimeSpan.Zero if the conversion failed. This
			//     parameter is passed uninitialized.
			//
			// Returns:
			//     true if input was converted successfully; otherwise, false.
			public: static bool TryParseExact(string* input, string* format, IFormatProvider* formatProvider, TimeSpan out result);

			//
			// Summary:
			//     Converts the specified string representation of a time interval to its System.TimeSpan
			//     equivalent by using the specified formats and culture-specific format information,
			//     and returns a value that indicates whether the conversion succeeded. The
			//     format of the string representation must match one of the specified formats
			//     exactly.
			//
			// Parameters:
			//   input:
			//     A string that specifies the time interval to convert.
			//
			//   formats:
			//     A array of standard or custom format strings that define the acceptable formats
			//     of input.
			//
			//   formatProvider:
			//     An object that provides culture-specific formatting information.
			//
			//   result:
			//     When this method returns, contains an object that represents the time interval
			//     specified by input, or System.TimeSpan.Zero if the conversion failed. This
			//     parameter is passed uninitialized.
			//
			// Returns:
			//     true if input was converted successfully; otherwise, false.
			public: static bool TryParseExact(string* input, Array<string>* formats, IFormatProvider* formatProvider, TimeSpan out result);

			//
			// Summary:
			//     Converts the string representation of a time interval to its System.TimeSpan
			//     equivalent by using the specified format, culture-specific format information,
			//     and styles, and returns a value that indicates whether the conversion succeeded.
			//     The format of the string representation must match the specified format exactly.
			//
			// Parameters:
			//   input:
			//     A string that specifies the time interval to convert.
			//
			//   format:
			//     A standard or custom format string that defines the required format of input.
			//
			//   formatProvider:
			//     An object that provides culture-specific formatting information.
			//
			//   styles:
			//     One or more enumeration values that indicate the style of input.
			//
			//   result:
			//     When this method returns, contains an object that represents the time interval
			//     specified by input, or System.TimeSpan.Zero if the conversion failed. This
			//     parameter is passed uninitialized.
			//
			// Returns:
			//     true if input was converted successfully; otherwise, false.
			public: static bool TryParseExact(string* input, string* format, IFormatProvider* formatProvider, Globalization::TimeSpanStyles* styles, TimeSpan out result);

			//
			// Summary:
			//     Converts the specified string representation of a time interval to its System.TimeSpan
			//     equivalent by using the specified formats, culture-specific format information,
			//     and styles, and returns a value that indicates whether the conversion succeeded.
			//     The format of the string representation must match one of the specified formats
			//     exactly.
			//
			// Parameters:
			//   input:
			//     A string that specifies the time interval to convert.
			//
			//   formats:
			//     A array of standard or custom format strings that define the acceptable formats
			//     of input.
			//
			//   formatProvider:
			//     An object that supplies culture-specific formatting information.
			//
			//   styles:
			//     One or more enumeration values that indicate the style of input.
			//
			//   result:
			//     When this method returns, contains an object that represents the time interval
			//     specified by input, or System.TimeSpan.Zero if the conversion failed. This
			//     parameter is passed uninitialized.
			//
			// Returns:
			//     true if input was converted successfully; otherwise, false.
			public: static bool TryParseExact(string* input, Array<string>* formats, IFormatProvider* formatProvider, Globalization::TimeSpanStyles* styles, TimeSpan out result);

		};

		// Summary:
		//     Returns a System.TimeSpan whose value is the negated value of the specified
		//     instance.
		//
		// Parameters:
		//   t:
		//     The time interval to be negated.
		//
		// Returns:
		//     An object that has the same numeric value as this instance, but the opposite
		//     sign.
		//
		// Exceptions:
		//   System.OverflowException:
		//     The negated value of this instance cannot be represented by a System.TimeSpan;
		//     that is, the value of this instance is System.TimeSpan.MinValue.
		static TimeSpan operator -(TimeSpan t)
		{
			return t.Negate();
		}

		//
		// Summary:
		//     Subtracts a specified System.TimeSpan from another specified System.TimeSpan.
		//
		// Parameters:
		//   t1:
		//     The minuend.
		//
		//   t2:
		//     The subtrahend.
		//
		// Returns:
		//     An object whose value is the result of the value of t1 minus the value of
		//     t2.
		//
		// Exceptions:
		//   System.OverflowException:
		//     The return value is less than System.TimeSpan.MinValue or greater than System.TimeSpan.MaxValue.
		//[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
		static TimeSpan operator -(TimeSpan t1, TimeSpan t2)
		{
			return t1.Subtract(t2);
		}

		//
		// Summary:
		//     Indicates whether two System.TimeSpan instances are not equal.
		//
		// Parameters:
		//   t1:
		//     The first time interval to compare.
		//
		//   t2:
		//     The second time interval to compare.
		//
		// Returns:
		//     true if the values of t1 and t2 are not equal; otherwise, false.
		//[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
		static bool operator !=(TimeSpan t1, TimeSpan t2)
		{
			return t1.Ticks != t2.Ticks;
		}

		//
		// Summary:
		//     Returns the specified instance of System.TimeSpan.
		//
		// Parameters:
		//   t:
		//     The time interval to return.
		//
		// Returns:
		//     The time interval specified by t.
		static TimeSpan operator +(TimeSpan t)
		{
			return t;
		}

		//
		// Summary:
		//     Adds two specified System.TimeSpan instances.
		//
		// Parameters:
		//   t1:
		//     The first time interval to add.
		//
		//   t2:
		//     The second time interval to add.
		//
		// Returns:
		//     An object whose value is the sum of the values of t1 and t2.
		//
		// Exceptions:
		//   System.OverflowException:
		//     The resulting System.TimeSpan is less than System.TimeSpan.MinValue or greater
		//     than System.TimeSpan.MaxValue.
		static TimeSpan operator +(TimeSpan t1, TimeSpan t2)
		{
			return t1.Add(t2);
		}

		//
		// Summary:
		//     Indicates whether a specified System.TimeSpan is less than another specified
		//     System.TimeSpan.
		//
		// Parameters:
		//   t1:
		//     The first time interval to compare.
		//
		//   t2:
		//     The second time interval to compare.
		//
		// Returns:
		//     true if the value of t1 is less than the value of t2; otherwise, false.
		//[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
		static bool operator <(TimeSpan t1, TimeSpan t2)
		{
			return t1.Ticks < t2.Ticks;
		}

		//
		// Summary:
		//     Indicates whether a specified System.TimeSpan is less than or equal to another
		//     specified System.TimeSpan.
		//
		// Parameters:
		//   t1:
		//     The first time interval to compare.
		//
		//   t2:
		//     The second time interval to compare.
		//
		// Returns:
		//     true if the value of t1 is less than or equal to the value of t2; otherwise,
		//     false.
		//[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
		static bool operator <=(TimeSpan t1, TimeSpan t2)
		{
			return t1.Ticks <= t2.Ticks;
		}

		//
		// Summary:
		//     Indicates whether two System.TimeSpan instances are equal.
		//
		// Parameters:
		//   t1:
		//     The first time interval to compare.
		//
		//   t2:
		//     The second time interval to compare.
		//
		// Returns:
		//     true if the values of t1 and t2 are equal; otherwise, false.
		//[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
		static bool operator ==(TimeSpan t1, TimeSpan t2)
		{
			return t1.Ticks == t2.Ticks;
		}

		//
		// Summary:
		//     Indicates whether a specified System.TimeSpan is greater than another specified
		//     System.TimeSpan.
		//
		// Parameters:
		//   t1:
		//     The first time interval to compare.
		//
		//   t2:
		//     The second time interval to compare.
		//
		// Returns:
		//     true if the value of t1 is greater than the value of t2; otherwise, false.
		//[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
		static bool operator >(TimeSpan t1, TimeSpan t2)
		{
			return t1.Ticks > t2.Ticks;
		}

		//
		// Summary:
		//     Indicates whether a specified System.TimeSpan is greater than or equal to
		//     another specified System.TimeSpan.
		//
		// Parameters:
		//   t1:
		//     The first time interval to compare.
		//
		//   t2:
		//     The second time interval to compare.
		//
		// Returns:
		//     true if the value of t1 is greater than or equal to the value of t2; otherwise,
		//     false.
		//[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
		static bool operator >=(TimeSpan t1, TimeSpan t2)
		{
			return t1.Ticks >= t2.Ticks;
		}

	}
}

#endif